package bg.btanev.eightyfour.domain.profile.feed;

import bg.btanev.eightyfour.domain.entitybase.DomainValue;

public class FeedMediaContentDimensions implements DomainValue {
	/**
	 *
	 */
	private static final long serialVersionUID = -4000852130448100838L;

	private int width;
	private int height;

	protected FeedMediaContentDimensions() {
	}

	public FeedMediaContentDimensions(int width, int height) {
		super();

		if (width <= 0 || height <= 0) {
			throw new IllegalArgumentException("dimentions cannot be non positive numbers");
		}

		this.width = width;
		this.height = height;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + height;
		result = prime * result + width;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FeedMediaContentDimensions other = (FeedMediaContentDimensions) obj;
		if (height != other.height)
			return false;
		if (width != other.width)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "FeedMediaContentDimetions [height=" + height + ", width=" + width + "]";
	}
}
